﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

using LuckyBingoRcon.Commands.Events;

namespace LuckyBingoRcon.Commands
{
	public class MessageCommand : Command
	{
		public EventHandler<MessageCommandEventArgs> OnResponse;

        // We have two choices here: 
        // 1.) We can send a message that the entire server sees (say <Message>)
        // 2.) We can send a message that a particular player sees (tell <Player> <Message>)
        // sayToAll will simply set the base command appropriately, need to intelligently given arguments 
        // to differentiate say and tell
        // Take note of the space after the commmand
        public MessageCommand(bool sayToAll)
        {
            if(sayToAll)
                base.commandText = "say ";
            else
                base.commandText = "tell ";

            base.args = null;
        }

		protected override void CommandOnResponse(string response)
        {
            // This should be write-only.
        }

        public override string ToString()
        {
            if (base.commandText.Equals("say"))
                return base.commandText + "\tto\tall\t" + base.args[0];
            else
                return base.commandText + "\tto\t" + base.args[0] + "\t" + base.args[1];
        }
	}
}
